home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
tex
/
rtextu10.zip
/
NODUP.DOC
< prev
next >
Wrap
Text File
|
1993-05-06
|
5KB
|
138 lines
# # ######
## # #### # # # # #####
# # # # # # # # # # #
# # # # # # # # # # #
# # # # # # # # # #####
# ## # # # # # # #
# # #### ###### #### #
You can get part of the following documentation by invoking the program with
the switches -v, -h, or -H . See README.TXT for more information.
----------------------------------- -v ------------------------------------
NODUP v1.0 -- Remove successive equal lines from text files
Copr (c) 1992,1993 Richard Breuer. NODUP is freeware. No warranties.
This is NODUP/2 v1.0 - renamed to NODUP (from RUTILS 4).
Author: Richard Breuer
Brunssumstrasse 6
5100 Aachen
(after Jul 1, 1993: 52074 Aachen)
Germany
Europe
Phone: +49/241/85605
Fax: +49/241/8021329
Email: ricki@pool.informatik.rwth-aachen.de (Preferred!)
----------------------------------- -h ------------------------------------
NODUP v1.0 -- Remove successive equal lines from text files
Copr (c) 1992,1993 Richard Breuer. NODUP is freeware. No warranties.
Usage:
NODUP [-b:e:hHiv*] infile.. [{>|>>} outfile]
Options:
-b[n] The comparison begins at column n. If n is 0 or negative, it is
computed to length(line)-n. Default is n=1
-e[n] The comparison ends at column n. If n is 0 or negative, it is
computed to length(line)-n. Default is n=0
-h Display this help screen
-H Display another help screen with notes and examples
-i NODUP ignores upper or lower case. Default is case sensitivity
-v Display version info and information about the author
-* Display internal information (for debugging purposes)
----------------------------------- -H ------------------------------------
NODUP v1.0 -- Remove successive equal lines from text files
Copr (c) 1992,1993 Richard Breuer. NODUP is freeware. No warranties.
Notes:
NODUP reads from stdin if a filename is -. The output is always directed
to stdout. The line lengths are restricted to 255 characters. Longer lines
will be cut. The errorlevel is set to 1 if help has been displayed. It is
set to 255 in case of an error and 0 on normal completion. Output resulting
from multiple input files is appended to stdout. The processing order for
wildcards depends on the order of the directory entries. NODUP returns
nonsense for binary files.
Examples:
NODUP *.TXT -
After processing all TXT files in the current directory the user must
input text from the keyboard until Ctrl/Z (=EOF) is detected. All output
is appended on stdout. The order of the files is the one DOS's dir tells
you.
DIR | NODUP -b10 -e10
If the directory is sorted by extensions, NODUP shows only the first
file for each extension in the list.
-------------------------------------------------------------------------------
Additional information:
NODUP was actually the starting point for all the other programs. I searched
for this program some time, could not locate it, and decided to write it
myself. It has been useful in many situations since then. Whenever you have
a list of any kind and want to get rid of double entries, NODUP comes up.
It is especially useful in combination with the SORT command, because SORT
arranges all equal lines of a file in one block after each other. NODUP can
then be used to remove all successive lines but the first.
Examples:
Consider the following file FOO.DAT:
>Name A<
>Name B<
>File A<
>File A<
>Name C<
>Name C<
>Name C<
Applying NODUP to it produces the following result:
NODUP FOO.DAT
>Name A<
>Name B<
>File A<
>Name C<
You expected this, didn't you :-) NODUP removed all successive equal lines
from FOO.DAT and wrote the result to standard output. In this case, the
result of
SORT < FOO.DAT | NODUP
would have been
>File A<
>Name A<
>Name B<
>Name C<
The options -b and -e allow you to decrease the range of rtext which is
relevant for NODUP for determining whether two lines are equal. Thus
SORT < FOO.DAT | NODUP -e4
results in
>File A<
>Name A<
because 'Name A', 'Name B', and 'Name C' are all equal if you look only at
the characters 1..4.
On the other hand,
SORT < FOO.DAT | NODUP -b5
gives
>File A<
>Name B<
>Name C<
because now 'File A' = 'Name A', restricted to characters 5..6.
The switch -i needs no further explanation, I guess. Oops, I should mention
that it is aware of the following characters (besides the usual, of course):
ä - Ä ö - Ö ü - Ü å - Å æ - Æ é - É ñ - Ñ ç - Ç